/*
 * VideoGUI_v1View.java
 */

package videogui_v1;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import videoComponents.VideoFrame;

/**
 * The application's main frame.
 */
public class VideoGUI_v1View extends FrameView {

    public VideoGUI_v1View(SingleFrameApplication app) {
        super(app);

        initComponents();
/*
        BufferedImage bufImage = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
        Graphics2D graphics2D = bufImage.createGraphics();
        Image image = java.awt.Toolkit.getDefaultToolkit().getImage("D:\\pix\\180004_177692212266911_100000784007548_338235_2289551_n.jpg");

        /*
        Graphics graphics = m_videoArea.getGraphics();
        if(graphics != null)
        {
            graphics.drawImage(image, 0, 0, m_videoArea);
        }*/

        m_videoFrame = new VideoFrame();
       
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = VideoGUI_v1App.getApplication().getMainFrame();
            aboutBox = new VideoGUI_v1AboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        VideoGUI_v1App.getApplication().show(aboutBox);


    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        m_videoArea = new javax.swing.JFrame();

        mainPanel.setName("mainPanel"); // NOI18N

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        m_videoArea.setBounds(new java.awt.Rectangle(0, 0, 100, 100));
        m_videoArea.setName("m_videoArea"); // NOI18N

        javax.swing.GroupLayout m_videoAreaLayout = new javax.swing.GroupLayout(m_videoArea.getContentPane());
        m_videoArea.getContentPane().setLayout(m_videoAreaLayout);
        m_videoAreaLayout.setHorizontalGroup(
            m_videoAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        m_videoAreaLayout.setVerticalGroup(
            m_videoAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        setComponent(mainPanel);
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFrame m_videoArea;
    private javax.swing.JPanel mainPanel;
    // End of variables declaration//GEN-END:variables

    private JDialog aboutBox;

    private VideoFrame m_videoFrame;
}
